package com.tianqu.tms.www.cardect.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tianqu.tms.core.base.Logger;
import com.tianqu.tms.core.base.TmsAction;
import com.tianqu.tms.core.base.UserContext;
import com.tianqu.tms.core.util.StringUtil;
import com.tianqu.tms.core.util.TmsConstants;
import com.tianqu.tms.www.cardect.actionform.CarNormalDetectForm;
import com.tianqu.tms.www.cardect.viewhelper.CarNormalDetectViewHelper;
/**
 * 
 * 普通检测一、用于图片上传的中转
 * 
 * 页面提交的时候将表单信息放到uc中待调用
 * 
 * @author tianshifu
 *
 */
public class CarWDPersonNormalDetectPicDispatchAction extends TmsAction {
	private Logger logger = Logger.getLogger(CarWDPersonNormalDetectPicDispatchAction.class);//log
	private static final String IMGKEY = "imgKey";// 图片位置
	private static final String IMGTYPE = "imgType";// 图片类型
	private static final String CHKMODEL = "chkModel";//检测模式
	private static final String DETECT_POSITION = "detect_position";//检测位置，标识哪个button提交
	private static final String DETECT_INPUT_DATA = "detect_input_data";//检测录入信息,需要将检测信息放到这个uc中
	
	@Override
	protected ActionForward doAction(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response,
			UserContext uc) throws Exception {
		logger.debug(this.getClass().getName() + "#execute was called.");	
		String actionForward = "";
		CarNormalDetectForm normalForm = (CarNormalDetectForm)form;
		/***************每个页面图片对应的key值不同,取图片的时候需要在外面加一层图片类型判断******************/
		if(normalForm.getImageButton1()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "1");
			uc.setAttribute(CHKMODEL, "1");			
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton2()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "2");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton3()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "3");
			uc.setAttribute(CHKMODEL, "1");		
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton4()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "4");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		//-------------------------------------
		if(normalForm.getImageButton5()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "5");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton6()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "6");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton7()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "7");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton8()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "8");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton9()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "9");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton10()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "10");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton11()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "11");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton12()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "12");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton13()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "13");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton14()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "14");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton15()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "15");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton16()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "16");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton17()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "17");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton18()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "18");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton19()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "19");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton20()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "20");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton21()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "21");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton22()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "22");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton23()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "23");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton24()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "24");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton25()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "25");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton26()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "26");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton27()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "27");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton28()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "28");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton29()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "29");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton30()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "30");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton31()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "31");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton32()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "32");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton33()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "33");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton34()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "34");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton35()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "35");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton36()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "36");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton37()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "37");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton38()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "38");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton39()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "39");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton40()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "40");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton41()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "41");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton42()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "42");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton43()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "43");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton44()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "44");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton45()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "45");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton46()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "46");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton47()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "47");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton48()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "48");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton49()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "49");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton50()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "50");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton51()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "51");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton52()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "52");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton53()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "53");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton54()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "54");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton55()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "55");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton56()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "56");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton57()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "57");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton58()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "58");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton59()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "59");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton60()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "60");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton61()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "61");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton62()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "62");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton63()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "63");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton64()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "64");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}
		if(normalForm.getImageButton65()!=null)
		{
			uc.setAttribute(IMGTYPE, "2");
			uc.setAttribute(IMGKEY, "65");
			uc.setAttribute(CHKMODEL, "1");	
			actionForward = "imgInput";
		}

		if(normalForm.getSaveButton()!=null)
		{
			actionForward = "toDetectConfirm";//信息确认页
		} 
		
		//从uc中获取数据参数看是按钮位置 来进行页面跳转判定，并带出相应的值
		//每次都进入到这个Action中 进入到这个页面的时候需要传过来一个位置ID 根据位置ID对对应的选项进行添加
		//每次都需要判断是否为空，为空的话过掉
		//从form中获取页面表单
		CarNormalDetectForm normalDetectForm = (CarNormalDetectForm)form;		
		
		CarNormalDetectViewHelper topView = (CarNormalDetectViewHelper)uc.getAttribute(DETECT_INPUT_DATA);
		
				
		//向viewhelp中set列表list 包括缺陷程度描述和评分 从字典表中取得
//		Codes code = Codes.getInstance();

		String	position = (String)uc.getAttribute(DETECT_POSITION);
		
		//根据位置跳转到不同的页面
		if(position.equals("1"))
		{
			//一、左前门检测录入  向页面打出信息 
			//左前门	 左A柱	左B柱	左前门内饰   左前门玻璃  左前门下边沿	左前车身底板	左前车身底盘	左侧中部车身纵梁
			topView.setFrontLeftChk1(getdetectStr(normalDetectForm.getFrontLeftChkS1(),normalDetectForm.getFrontLeftChkC1()));
			topView.setFrontLeftChk2(getdetectStr(normalDetectForm.getFrontLeftChkS2(),""));
			topView.setFrontLeftChk3(getdetectStr(normalDetectForm.getFrontLeftChkS3(),""));
			topView.setFrontLeftChk4(getdetectStr(normalDetectForm.getFrontLeftChkS4(),normalDetectForm.getFrontLeftChkC4()));
			topView.setFrontLeftChk5(getdetectStr(normalDetectForm.getFrontLeftChkS5(),normalDetectForm.getFrontLeftChkC5()));
			topView.setFrontLeftChk6(getdetectStr(normalDetectForm.getFrontLeftChkS6(),normalDetectForm.getFrontLeftChkC6()));
			topView.setFrontLeftChk7(getdetectStr(normalDetectForm.getFrontLeftChkS7(),normalDetectForm.getFrontLeftChkC7()));
			topView.setFrontLeftChk8(getdetectStr(normalDetectForm.getFrontLeftChkS8(),normalDetectForm.getFrontLeftChkC8()));
			topView.setFrontLeftChk9(getdetectStr(normalDetectForm.getFrontLeftChkS9(),""));
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "1");
			
		}
		if(position.equals("2"))
		{
			//二、内饰检测录入
			topView.setInsideChk1(getdetectStr(normalDetectForm.getInsideChkS1(),normalDetectForm.getInsideChkC1()));
			topView.setInsideChk2(getdetectStr(normalDetectForm.getInsideChkS2(),normalDetectForm.getInsideChkC2()));
			topView.setInsideChk3(getdetectStr(normalDetectForm.getInsideChkS3(),normalDetectForm.getInsideChkC3()));
			topView.setInsideChk4(getdetectStr(normalDetectForm.getInsideChkS4(),normalDetectForm.getInsideChkC4()));
			topView.setInsideChk5(getdetectStr(normalDetectForm.getInsideChkS5(),normalDetectForm.getInsideChkC5()));
			topView.setInsideChk6(getdetectStr(normalDetectForm.getInsideChkS6(),normalDetectForm.getInsideChkC6()));
			topView.setInsideChk7(getdetectStr(normalDetectForm.getInsideChkS7(),normalDetectForm.getInsideChkC7()));
			topView.setInsideChk8(getdetectStr(normalDetectForm.getInsideChkS8(),normalDetectForm.getInsideChkC8()));
			topView.setInsideChk9(getdetectStr(normalDetectForm.getInsideChkS9(),normalDetectForm.getInsideChkC9()));
			topView.setInsideChk10(getdetectStr(normalDetectForm.getInsideChkS10(),normalDetectForm.getInsideChkC10()));
			topView.setInsideChk11(getdetectStr(normalDetectForm.getInsideChkS11(),normalDetectForm.getInsideChkC11()));
			topView.setInsideChk12(getdetectStr(normalDetectForm.getInsideChkS12(),normalDetectForm.getInsideChkC12()));
			topView.setInsideChk13(getdetectStr(normalDetectForm.getInsideChkS13(),normalDetectForm.getInsideChkC13()));
			topView.setInsideChk14(getdetectStr(normalDetectForm.getInsideChkS14(),normalDetectForm.getInsideChkC14()));
			topView.setInsideChk15(getdetectStr(normalDetectForm.getInsideChkS15(),normalDetectForm.getInsideChkC15()));
			topView.setInsideChk16(getdetectStr(normalDetectForm.getInsideChkS16(),normalDetectForm.getInsideChkC16()));
			topView.setInsideChk17(getdetectStr(normalDetectForm.getInsideChkS17(),normalDetectForm.getInsideChkC17()));
			topView.setInsideChk18(getdetectStr(normalDetectForm.getInsideChkS18(),normalDetectForm.getInsideChkC18()));
			topView.setInsideChk19(getdetectStr(normalDetectForm.getInsideChkS19(),normalDetectForm.getInsideChkC19()));
			topView.setInsideChk20(getdetectStr(normalDetectForm.getInsideChkS20(),normalDetectForm.getInsideChkC20()));
			topView.setInsideChk21(getdetectStr(normalDetectForm.getInsideChkS21(),normalDetectForm.getInsideChkC21()));
			topView.setInsideChk22(getdetectStr(normalDetectForm.getInsideChkS22(),normalDetectForm.getInsideChkC22()));
			topView.setInsideChk23(getdetectStr(normalDetectForm.getInsideChkS23(),normalDetectForm.getInsideChkC23()));
			topView.setInsideChk24(getdetectStr(normalDetectForm.getInsideChkS24(),normalDetectForm.getInsideChkC24()));
			topView.setInsideChk25(getdetectStr(normalDetectForm.getInsideChkS25(),normalDetectForm.getInsideChkC25()));
			topView.setInsideChk26(getdetectStr(normalDetectForm.getInsideChkS26(),normalDetectForm.getInsideChkC26()));
			topView.setInsideChk27(getdetectStr(normalDetectForm.getInsideChkS27(),normalDetectForm.getInsideChkC27()));
			topView.setInsideChk28(getdetectStr(normalDetectForm.getInsideChkS28(),normalDetectForm.getInsideChkC28()));
			topView.setInsideChk29(getdetectStr(normalDetectForm.getInsideChkS29(),normalDetectForm.getInsideChkC29()));
			topView.setInsideChk30(getdetectStr(normalDetectForm.getInsideChkS30(),normalDetectForm.getInsideChkC30()));
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "2");
		}
		if(position.equals("3"))
		{
			//三、左前翼子板检测录入
			topView.setPanelFenerLhChk1(getdetectStr(normalDetectForm.getPanelFenerLhChkS1(),normalDetectForm.getPanelFenerLhChkC1()));
			topView.setPanelFenerLhChk2(getdetectStr(normalDetectForm.getPanelFenerLhChkS2(),normalDetectForm.getPanelFenerLhChkC2()));
			topView.setPanelFenerLhChk3(getdetectStr(normalDetectForm.getPanelFenerLhChkS3(),normalDetectForm.getPanelFenerLhChkC3()));
			topView.setPanelFenerLhChk4(getdetectStr(normalDetectForm.getPanelFenerLhChkS4(),normalDetectForm.getPanelFenerLhChkC4()));
			topView.setPanelFenerLhChk5(getdetectStr(normalDetectForm.getPanelFenerLhChkS5(),normalDetectForm.getPanelFenerLhChkC5()));
			topView.setPanelFenerLhChk6(getdetectStr(normalDetectForm.getPanelFenerLhChkS6(),normalDetectForm.getPanelFenerLhChkC6()));
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "3");
		}
		if(position.equals("4"))
		{
			//四、正前面检测录入
			topView.setDeadAheadChk1(getdetectStr(normalDetectForm.getDeadAheadChkS1(),normalDetectForm.getDeadAheadChkC1()));
			topView.setDeadAheadChk2(getdetectStr(normalDetectForm.getDeadAheadChkS2(),normalDetectForm.getDeadAheadChkC2()));
			topView.setDeadAheadChk3(getdetectStr(normalDetectForm.getDeadAheadChkS3(),normalDetectForm.getDeadAheadChkC3()));
			topView.setDeadAheadChk4(getdetectStr(normalDetectForm.getDeadAheadChkS4(),normalDetectForm.getDeadAheadChkC4()));
			topView.setDeadAheadChk5(getdetectStr(normalDetectForm.getDeadAheadChkS5(),normalDetectForm.getDeadAheadChkC5()));
			topView.setDeadAheadChk6(getdetectStr(normalDetectForm.getDeadAheadChkS6(),normalDetectForm.getDeadAheadChkC6()));
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "4");
		}
		if(position.equals("5"))
		{
			//五、发动机舱内检测录入
			topView.setEngineChk1(getdetectStr(normalDetectForm.getEngineChkS1(),normalDetectForm.getEngineChkC1()));
			topView.setEngineChk2(getdetectStr(normalDetectForm.getEngineChkS2(),normalDetectForm.getEngineChkC2()));
			topView.setEngineChk3(getdetectStr(normalDetectForm.getEngineChkS3(),""));
			topView.setEngineChk4(getdetectStr(normalDetectForm.getEngineChkS4(),""));
			topView.setEngineChk5(getdetectStr(normalDetectForm.getEngineChkS5(),normalDetectForm.getEngineChkC5()));
			topView.setEngineChk6(getdetectStr(normalDetectForm.getEngineChkS6(),normalDetectForm.getEngineChkC6()));
			topView.setEngineChk7(getdetectStr(normalDetectForm.getEngineChkS7(),""));
			topView.setEngineChk8(getdetectStr(normalDetectForm.getEngineChkS8(),""));
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "5");
		}
		if(position.equals("6"))
		{
			 //六、右前翼子板检测录入			
			topView.setPanelFenerRhChk1(getdetectStr(normalDetectForm.getPanelFenerRhChkS1(),normalDetectForm.getPanelFenerRhChkC1()));
			topView.setPanelFenerRhChk2(getdetectStr(normalDetectForm.getPanelFenerRhChkS2(),normalDetectForm.getPanelFenerRhChkC2()));
			topView.setPanelFenerRhChk3(getdetectStr(normalDetectForm.getPanelFenerRhChkS3(),normalDetectForm.getPanelFenerRhChkC3()));
			topView.setPanelFenerRhChk4(getdetectStr(normalDetectForm.getPanelFenerRhChkS4(),normalDetectForm.getPanelFenerRhChkC4()));
			topView.setPanelFenerRhChk5(getdetectStr(normalDetectForm.getPanelFenerRhChkS5(),normalDetectForm.getPanelFenerRhChkC5()));
			topView.setPanelFenerRhChk6(getdetectStr(normalDetectForm.getPanelFenerRhChkS6(),normalDetectForm.getPanelFenerRhChkC6()));
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "6");
		}
		if(position.equals("7"))
		{
			//七、右前门检测录入
			topView.setFrontRightChk1(getdetectStr(normalDetectForm.getFrontRightChkS1(),normalDetectForm.getFrontRightChkC1()));
			topView.setFrontRightChk2(getdetectStr(normalDetectForm.getFrontRightChkS2(),""));
			topView.setFrontRightChk3(getdetectStr(normalDetectForm.getFrontRightChkS3(),""));
			topView.setFrontRightChk4(getdetectStr(normalDetectForm.getFrontRightChkS4(),normalDetectForm.getFrontRightChkC4()));
			topView.setFrontRightChk5(getdetectStr(normalDetectForm.getFrontRightChkS5(),normalDetectForm.getFrontRightChkC5()));
			topView.setFrontRightChk6(getdetectStr(normalDetectForm.getFrontRightChkS6(),normalDetectForm.getFrontRightChkC6()));
			topView.setFrontRightChk7(getdetectStr(normalDetectForm.getFrontRightChkS7(),normalDetectForm.getFrontRightChkC7()));
			topView.setFrontRightChk8(getdetectStr(normalDetectForm.getFrontRightChkS8(),normalDetectForm.getFrontRightChkC8()));
			topView.setFrontRightChk9(getdetectStr(normalDetectForm.getFrontRightChkS9(),normalDetectForm.getFrontRightChkC9()));
			topView.setFrontRightChk10(getdetectStr(normalDetectForm.getFrontRightChkS10(),normalDetectForm.getFrontRightChkC10()));
			topView.setFrontRightChk11(getdetectStr(normalDetectForm.getFrontRightChkS11(),normalDetectForm.getFrontRightChkC11()));
			topView.setFrontRightChk12(getdetectStr(normalDetectForm.getFrontRightChkS12(),normalDetectForm.getFrontRightChkC12()));
			topView.setFrontRightChk13(getdetectStr(normalDetectForm.getFrontRightChkS13(),""));

			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "7");
		}
		if(position.equals("8"))
		{
			//八、右后门检测录入
			topView.setRearRightChk1(getdetectStr(normalDetectForm.getRearRightChkS1(),normalDetectForm.getRearRightChkC1()));
			topView.setRearRightChk2(getdetectStr(normalDetectForm.getRearRightChkS2(),""));
			topView.setRearRightChk3(getdetectStr(normalDetectForm.getRearRightChkS3(),""));
			topView.setRearRightChk4(getdetectStr(normalDetectForm.getRearRightChkS4(),normalDetectForm.getRearRightChkC4()));
			topView.setRearRightChk5(getdetectStr(normalDetectForm.getRearRightChkS5(),normalDetectForm.getRearRightChkC5()));
			topView.setRearRightChk6(getdetectStr(normalDetectForm.getRearRightChkS6(),normalDetectForm.getRearRightChkC6()));
			topView.setRearRightChk7(getdetectStr(normalDetectForm.getRearRightChkS7(),normalDetectForm.getRearRightChkC7()));
			topView.setRearRightChk8(getdetectStr(normalDetectForm.getRearRightChkS8(),normalDetectForm.getRearRightChkC8()));
			topView.setRearRightChk9(getdetectStr(normalDetectForm.getRearRightChkS9(),normalDetectForm.getRearRightChkC9()));
			topView.setRearRightChk10(getdetectStr(normalDetectForm.getRearRightChkS10(),normalDetectForm.getRearRightChkC10()));
			topView.setRearRightChk11(getdetectStr(normalDetectForm.getRearRightChkS11(),normalDetectForm.getRearRightChkC11()));
			
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "8");
		}
		if(position.equals("9"))
		{
			 //九、右后翼子板检测录入
			topView.setFenderRaChk1(getdetectStr(normalDetectForm.getFenderRaChkS1(),normalDetectForm.getFenderRaChkC1()));
			topView.setFenderRaChk2(getdetectStr(normalDetectForm.getFenderRaChkS2(),normalDetectForm.getFenderRaChkC2()));
			topView.setFenderRaChk3(getdetectStr(normalDetectForm.getFenderRaChkS3(),normalDetectForm.getFenderRaChkC3()));
			topView.setFenderRaChk4(getdetectStr(normalDetectForm.getFenderRaChkS4(),normalDetectForm.getFenderRaChkC4()));
			topView.setFenderRaChk5(getdetectStr(normalDetectForm.getFenderRaChkS5(),normalDetectForm.getFenderRaChkC5()));
			topView.setFenderRaChk6(getdetectStr(normalDetectForm.getFenderRaChkS6(),normalDetectForm.getFenderRaChkC6()));
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "9");
		}
		if(position.equals("10"))
		{
			//十、正后面检测录入
			topView.setRightAsternChk1(getdetectStr(normalDetectForm.getRightAsternChkS1(),normalDetectForm.getRightAsternChkC1()));
			topView.setRightAsternChk2(getdetectStr(normalDetectForm.getRightAsternChkS2(),normalDetectForm.getRightAsternChkC2()));
			topView.setRightAsternChk3(getdetectStr(normalDetectForm.getRightAsternChkS3(),normalDetectForm.getRightAsternChkC3()));
			topView.setRightAsternChk4(getdetectStr(normalDetectForm.getRightAsternChkS4(),normalDetectForm.getRightAsternChkC4()));
			topView.setRightAsternChk5(getdetectStr(normalDetectForm.getRightAsternChkS5(),normalDetectForm.getRightAsternChkC5()));
			topView.setRightAsternChk6(getdetectStr(normalDetectForm.getRightAsternChkS6(),normalDetectForm.getRightAsternChkC6()));
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "10");
		}
		if(position.equals("11"))
		{
			//十一、行李箱内侧检测录入
			topView.setLuggageChk1(getdetectStr(normalDetectForm.getLuggageChkS1(),normalDetectForm.getLuggageChkC1()));
			topView.setLuggageChk2(getdetectStr(normalDetectForm.getLuggageChkS2(),normalDetectForm.getLuggageChkC2()));
			topView.setLuggageChk3(getdetectStr(normalDetectForm.getLuggageChkS3(),""));
			topView.setLuggageChk4(getdetectStr(normalDetectForm.getLuggageChkS4(),""));
			topView.setLuggageChk5(getdetectStr(normalDetectForm.getLuggageChkS5(),normalDetectForm.getLuggageChkC5()));
			topView.setLuggageChk6(getdetectStr(normalDetectForm.getLuggageChkS6(),normalDetectForm.getLuggageChkC6()));
			topView.setLuggageChk7(getdetectStr(normalDetectForm.getLuggageChkS7(),""));
			topView.setLuggageChk8(getdetectStr(normalDetectForm.getLuggageChkS8(),""));
			topView.setLuggageChk9(getdetectStr(normalDetectForm.getLuggageChkS9(),normalDetectForm.getLuggageChkC9()));
			topView.setLuggageChk10(getdetectStr(normalDetectForm.getLuggageChkS10(),normalDetectForm.getLuggageChkC10()));
			
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "11");
		}
		if(position.equals("12"))
		{
			 //十二、左后翼子板检测录入
			topView.setFenderLaChk1(getdetectStr(normalDetectForm.getFenderLaChkS1(),normalDetectForm.getFenderLaChkC1()));
			topView.setFenderLaChk2(getdetectStr(normalDetectForm.getFenderLaChkS2(),normalDetectForm.getFenderLaChkC2()));
			topView.setFenderLaChk3(getdetectStr(normalDetectForm.getFenderLaChkS3(),normalDetectForm.getFenderLaChkC3()));
			topView.setFenderLaChk4(getdetectStr(normalDetectForm.getFenderLaChkS4(),normalDetectForm.getFenderLaChkC4()));
			topView.setFenderLaChk5(getdetectStr(normalDetectForm.getFenderLaChkS5(),normalDetectForm.getFenderLaChkC5()));
			topView.setFenderLaChk6(getdetectStr(normalDetectForm.getFenderLaChkS6(),normalDetectForm.getFenderLaChkC6()));
			
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "12");
		}
		if(position.equals("13"))
		{
			//十三、左后门检测录入
			topView.setRearLeftChk1(getdetectStr(normalDetectForm.getRearLeftChkS1(),normalDetectForm.getRearLeftChkC1()));
			topView.setRearLeftChk2(getdetectStr(normalDetectForm.getRearLeftChkS2(),""));
			topView.setRearLeftChk3(getdetectStr(normalDetectForm.getRearLeftChkS3(),""));
			topView.setRearLeftChk4(getdetectStr(normalDetectForm.getRearLeftChkS4(),normalDetectForm.getRearLeftChkC4()));
			topView.setRearLeftChk5(getdetectStr(normalDetectForm.getRearLeftChkS5(),normalDetectForm.getRearLeftChkC5()));
			topView.setRearLeftChk6(getdetectStr(normalDetectForm.getRearLeftChkS6(),normalDetectForm.getRearLeftChkC6()));
			topView.setRearLeftChk7(getdetectStr(normalDetectForm.getRearLeftChkS7(),normalDetectForm.getRearLeftChkC7()));
			topView.setRearLeftChk8(getdetectStr(normalDetectForm.getRearLeftChkS8(),normalDetectForm.getRearLeftChkC8()));
			topView.setRearLeftChk9(getdetectStr(normalDetectForm.getRearLeftChkS9(),normalDetectForm.getRearLeftChkC9()));
			topView.setRearLeftChk10(getdetectStr(normalDetectForm.getRearLeftChkS10(),normalDetectForm.getRearLeftChkC10()));
			topView.setRearLeftChk11(getdetectStr(normalDetectForm.getRearLeftChkS11(),normalDetectForm.getRearLeftChkC11()));
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "13");
		}
		if(position.equals("14"))
		{
			//十四、车顶检测录入
			topView.setCarRoofChk1(getdetectStr(normalDetectForm.getCarRoofChkS1(),normalDetectForm.getCarRoofChkC1()));
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "14");
		}
		if(position.equals("15"))
		{
			//十五、检测说明录入
			topView.setCarDescribe(normalDetectForm.getCarDescribe());
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "15");
		}
		
		request.setAttribute(TmsConstants.VIEWHELP, topView);
		uc.setAttribute(DETECT_INPUT_DATA, topView);//将检测信息set到uc中带进入首页时查看
		
		logger.debug(this.getClass().getName() + "#doAction was completed.");
		return mapping.findForward(actionForward);
	}
	
	/**
	 * 
	 * 合并字符串，放到首页检测报告录入中
	 */
	private String getdetectStr(String decName,String decLevel)
	{
		String str = "-";
		if(!"".equals(StringUtil.isNULL(decName))&&!"".equals(StringUtil.isNULL(decLevel)))
		{
			//如果都不为空,缺陷+程度
			return (decName+decLevel);
		}
		if("".equals(StringUtil.isNULL(decName))&& "".equals(StringUtil.isNULL(decLevel)))
		{
			//同时为空，则返回"-"
			return str;
		}
		if(!"".equals(StringUtil.isNULL(decName)))
		{
			//如果缺陷名字不为空，则返回缺陷名
			return decName;
		}
		return str;
	}

}
